<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var grade = Number(prompt("请输入成绩："))
      var a, level
      a = grade / 10
      a = parseInt(a)
      console.log(a)
      switch (a) {
        case 10:
          alert("成绩为A!")
          break
        case 9:
          alert("成绩为A!")
          break
        case 8:
          alert("成绩为B!")
          break
        case 7:
          alert("成绩为C!")
          break
        case 6:
          alert("成绩为D!")
          break
        default:
          alert("成绩为E!")
      }
    </script>
  </body>
</html>
